    /***
     * @description axios封装
     * @file api.ts
     * @author andy
     * @date 2024/3/22 16:40
     */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// 发送验证码
export const sendCode = (userMobile:any) => {
    return service({
        url: '/user/tbUser/sendCode/' + userMobile,
        method: 'post'
    })
};


// 用户登录
export const userLogin = (data:any) => {
    return service({
        url: '/user/tbUser/userLogin',
        method: 'post',
        data
    })
};

// 分页获取日志列表(从ES中获取数据)
export const getSysLogByPage = (data:any) => {
    return service({
        url: '/user/tbUser/getSysLogByPage',
        method: 'post',
        data
    })
};


// 分页获取商品列表
export const getProdList = (data:any) => {
    return service({
        url: '/sailer/tbProduct/getProductList',
        method: 'post',
        data
    })
};

// 获取品牌列表（没有参数的接口）
export const getBrandList = () => {
    return service({
        url: '/sailer/tbProduct/getBrandList',
        method: 'post',
    })
};


// 添加商品到购物车
export const addProdToCar = (data:any) => {
    return service({
        url: '/sailer/tbProduct/addProdToCar',
        method: 'post',
        data
    })
};

// 下单接口
export const addOrder = (data:any) => {
    return service({
        url: '/sailer/tbProduct/addOrder',
        method: 'post',
        data
    })
};

// 分页过去订单列表
export const getOrderList = (data:any) => {
    return service({
        url: '/order/tbOrder/getOrderList',
        method: 'post',
        data
    })
};

// 获取最新一周的订单汇总金额
export const getAmountByLastWeek = () => {
    return service({
        url: '/order/tbOrder/getAmountByLastWeek',
        method: 'post',
    })
};